package com.lanou.lenanapp.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.lanou.lenanapp.factory.FragmentFactory;


/**
 * Created by dllo on 15/11/5.
 */
public class CollectTypeAdapter extends FragmentPagerAdapter {

    private String[] title = {"段子", "趣图"};

    public CollectTypeAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        return FragmentFactory.creatFragment(position);
    }

    @Override
    public int getCount() {
        return title.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return title[position];
    }
}
